﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dycox
{
    public static class StringHelper
    {
        public static string TrimToNull(this string text)
        {
            if (text != null)
            {
                text = text.Trim();
                if (text.Length > 0)
                    return text;
            }

            return null;
        }

        public static string EmptyToNull(this string text)
        {
            if (text != null && text.Length > 0)
                return text;
            else
                return null;
        }
    }
}
